package com.zhaokuner.dubbo.consumer.test;

import com.zhaokuner.dubbo.service.TestService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * <p>Description: {des}</p>
 * <p>
 * <p>Copyright:  2018-2020 北京掌通未来科技有限公司.All rights reserved.</p>
 *
 * @author zhaoxikun
 * @date 2020/6/20 22:34
 */
@Component
public class Client implements ApplicationRunner {

    @DubboReference
    private TestService testService;

    public Object test() {
        System.out.println(testService.sayHello("okkkk"));
        return "ok";
    }

    @Value("${spring.application.name}")
    private String serverName;
    @Override
    public void run(ApplicationArguments args) {
        System.setProperty("serverName",serverName);
    }
}
